package com.maozw.aop.controller;

import com.maozw.aop.annotation.Maoge;
import com.maozw.aop.aspect.DynamicAspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by bjmaozhengwei on 2018/7/4.
 */

@Controller
@RequestMapping("/API")
public class TestController {

    @Autowired
    private TestController testController;

    private static final Logger logger = LoggerFactory.getLogger(DynamicAspect.class);
    @RequestMapping("/test1")
    @ResponseBody
    public String test1() {
        logger.info("test1");
        return "test1";
    }

   // @Maoge(value = "/ttt")
    @RequestMapping("/mao2")
    @ResponseBody
    public String test2(String ss) {
        logger.info("test2");

        testController.maogeTest();
        return "mmm";
    }


    @Maoge(value = "/txxxx")
    @RequestMapping("/mao3")
    @ResponseBody
    public String test3(String ss) {
        logger.info("mao3");
        return "hhhh";
    }


    @Maoge(value = "/ttt")
    public void maogeTest(){
        logger.info("maogeTest");
        logger.info("maogeTest");
        logger.info("maogeTest");
    }
}
